package com.bj58.mis.apm.server.kylinreceive.schedule;

import com.bj58.mis.apm.server.kylinreceive.service.WarnService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: wangxw
 * @Date: 2018/7/20 15:04
 */
@Component
@ConditionalOnProperty(name = "schedule.unused.enable", havingValue = "true")
public class CubeUnusedSchedule {

    @Resource
    private WarnService warnService;

    /**
     *  更新storage统计数据
     */
    @Scheduled(cron = "${schedule.unused.cron}")
    public void updateStorage(){
        warnService.checkUsed();
    }
}
